package pl.edu.agh.ki.ewywiadowka.client.dto;

import java.util.Calendar;
import java.util.Date;

import com.google.gwt.user.client.rpc.IsSerializable;

public class ClassDTO implements IsSerializable {

	public Integer id;
	public TeacherDTO educator;
	public Character letter;
	public Date annual;

	public ClassDTO() {}
	
	public ClassDTO(Integer id, Date annual, Character letter,
			TeacherDTO educator) {
		super();
		this.id = id;
		this.educator = educator;
		this.letter = letter;
		this.annual = annual;
	}


	public String toString() {
		return (annual.getYear() + 1900) + " " + letter + " " + educator.toString(); 
	}
	
	public boolean equals(ClassDTO cdto) {
		return letter.equals(cdto.letter) && ((annual.getYear()+1900)==cdto.annual.getYear() || annual.getYear()==cdto.annual.getYear() || annual.getYear()==(cdto.annual.getYear()+1900));
	}

}
